/* 
 * File:   TestResults.h
 * Author: ungerma
 *
 * Created on 11. August 2014, 11:55
 */

#ifndef TESTRESULTS_H
#define	TESTRESULTS_H

#include <cstdlib>
#include <cstdio>
#include <exception>
#include <stdexcept>
#include <fstream>
#include <string>

#include "opencv2/opencv.hpp"

using namespace cv;
using namespace std;

class TestResults {
public:
    
    TestResults();
    void result(float y, float groundTruth, float classificationResult, string
        id);
    float getPrecision();
    float getRecall();
    void summaryOutput();
    void trace();
    void precisionRecallCurve(string filename);
    string okString();
    
    static const float CLASS_A       =  1.0;
    static const float CLASS_B       = -1.0;
    static const float CLASS_UNKNOWN =  0.0;
    
    /*
     * While generating the precision recall curve, the class boundary is
     * increased by this at each step from min to max.
     */
    static const float PR_STEP_SIZE  =  0.1;
    static const float PR_MIN        = -3.0;
    static const float PR_MAX        =  3.0;
    
private:
    
    vector<float> ys;
    vector<float> truths;
    float aa, bb, ab, ba, right, wrong, as, bs, minY, maxY;
    vector<string> wrongIds;
    
};

#endif	/* TESTRESULTS_H */

